﻿#if UNITY_EDITOR
using System.Collections.Generic;
using Ease.EaseNode.Runtime.Param;

namespace Ease.EaseNode.Runtime
{
    public static class StateManager
    {
        private static HashSet<IEaseNodeDataState> allStates = new HashSet<IEaseNodeDataState>();

        public static void Add(IEaseNodeDataState state)
        {
            if (state != null)
                allStates.Add(state);
        }

        public static void Reset()
        {
            foreach (var easeNodeDataState in allStates)
            {
                easeNodeDataState.CurrentNodeState = NodeState.None;
                easeNodeDataState.OnValueChange(new StateChangeParam() { newState = NodeState.None });
            }
        }
    }
}
#endif